<template>
    <a-config-provider :locale="locale">
        <router-view v-if="isRouterAlive"/>
    </a-config-provider>
</template>

<script>
    import moment from "moment";
    import "moment/locale/en-gb";
    import zhCN from 'ant-design-vue/lib/locale-provider/zh_CN';
    import "moment/locale/zh-cn";

    moment.locale("zh-cn");

    export default {
        provide() {
            return {
                reload: this.reload,
            }
        },
        data() {
            return {
                locale: zhCN,
                isRouterAlive: true
            };
        },
        methods: {
            reload() {
                this.isRouterAlive = false;
                this.$nextTick(() => {
                    this.isRouterAlive = true;
                })
            }
        }
    };
</script>
